const db = require("./database.js")

async function insertFeedback(feedback) {
  return new Promise((resolve, reject) => {
    db.run('insert into feedback(phone_number, content, create_time) values (?,?,?)', [feedback.phone_number, feedback.content, feedback.create_time], (err, result) => {
      if (err) {
        reject(err);
      } else {
        resolve(result);
      }
    })
  })
}

module.exports = { insertFeedback }
